str_0 = "If only the moon was a little brighter, so that I could see whether the flickering things in your eyes like it or not."
# Print the percentage of "I" or "i" in str_0 like "36.5%".
total_len = len(str_0)  # 记录总的字符数量
current_index = 0  # 当前字符的索引号
i_lower_count = 0  # 用于计数总的小写i的数量
i_upper_count = 0  # 用于计数总的大写I的数量
while current_index < total_len:
    # 注意不能等于，因为str_0[current_index]是用0开始到total_len-1结束
    if str_0[current_index] == "I":
        i_upper_count += 1  # 大写i计数增加1
    elif str_0[current_index] == "i":
        i_lower_count += 1  # 小写i计数增加1
    current_index += 1  # 循环控制的一部分，再次进入循环式，可以检查下一个index
i_lower_percentage = 100 * i_lower_count / total_len  # 计算百分比数字
i_upper_percentage = 100 * i_lower_count / total_len  # 计算百分比数字
print(f"Percentage of i is {i_lower_percentage}%")
print(f"Percentage of I is {i_upper_percentage}%")
